package com.xintoucloud.gsv.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xintoucloud.gsv.entity.User;
import com.xintoucloud.gsv.model.DataGrid;
import com.xintoucloud.gsv.model.SuperVisionDto;
import com.xintoucloud.gsv.service.SuperVisionService;

@Controller
public class SuperVisionVisionReplyController {
	@Autowired
	private SuperVisionService superVisionService;
	
	@RequestMapping("/toSuperVisionVisionReply")
	public String toSuperVision() {
		return "superVisionVisionConfirm";		
	}
	@RequestMapping("/showSuperVisionVisionReply")
	@ResponseBody
	public DataGrid<SuperVisionDto> showSuperVisionVisionReply(Model m,HttpServletRequest request,HttpSession session) {
		//1.获取参数
		 String page = request.getParameter("page");// 获取当前页 
		 String size = request.getParameter("limit");// 获取每页信息显示的条数 
				 User user=(User) session.getAttribute("User");
				 int uid=user.getUid();
				 //System.out.println("did:"+did);
		 //2.数据库执行分页操作
		DataGrid<SuperVisionDto> superVisions=superVisionService.listWaitVisionConfirm(Integer.parseInt(page), Integer.parseInt(size));
		//System.out.println("count:"+superVisions.getCount());
		m.addAttribute("superVisions", superVisions);
		return superVisions;
	}
}
